//-----------------------------------------------------------------------
// <copyright file="SubscribesToAttribute.cs" company="iron9light">
//      Copyright (c) iron9light. All rights reserved.
// </copyright>
// <author>iron9light</author>
//-----------------------------------------------------------------------

namespace EventBrokerExtension
{
    using System;

    /// <summary>
    /// Marks a method as a subscriber.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
    public sealed class SubscribesToAttribute : Attribute
    {
        private readonly string eventTopic;

        /// <summary>
        /// Initializes a new instance of the <see cref="SubscribesToAttribute"/> class.
        /// </summary>
        /// <param name="eventTopic">Name of the event topic.</param>
        public SubscribesToAttribute(string eventTopic)
        {
            this.eventTopic = eventTopic;
        }

        /// <summary>
        /// Gets the name of the event topic.
        /// </summary>
        /// <value>The name of the event topic.</value>
        public string EventTopic
        {
            get { return this.eventTopic; }
        }
    }
}